import {mapLinkage, ArcgisTool, esri} from "../arcgisUtils/ArcgisTool";
import {digitalManagement} from "./digitalManagement";
import {PopupEffect} from "../arcgisUtils/Extend/popupEffect";
import {baiduMap} from "../arcgisUtils/Extend/otherMap/baiduMap";
import {AddGeometry, AddTest, threeManage} from "../arcgisUtils/Extend/three/index";

export const itemClick = {};
itemClick["webgl"] = function (arcgisTool, mapId) {
  let view = arcgisTool.manageView.getView();
  let pos = [
    119.31591786760907,
    26.04907462710471,
    10
  ]
  // let three2 = new AddGeometry(view,pos);
  // let pos1 = [13276641.122260105,3006293.457277403,0]
  // pos1 = [119.26273883853494,26.04881535727517,0]
  // let three1 = new AddGeometry(view,pos1);
  // let  a = 1;
  new AddTest(view, pos);
}


/***************************************多地图操作*****************************************************************/
itemClick["不同地图间的联动"] = function (arcgisTool) {
  let newMap = document.createElement("div");
  newMap.id = "newMap";
  newMap.style.width = "500px"
  document.getElementById("helloworld").appendChild(newMap)
  setTimeout(() => {
    let arcgisTool1 = new ArcgisTool("newMap");
    // let layer = arcgisTool.manageLayer.applyTileLayerByUrl( "底图图层", "http://120.40.102.239:9651/arcgis/rest/services/Fuzhou_fullcover_vec_map/MapServer")
    let layer = arcgisTool1.manageLayer.applyTileLayerByUrl("底图图层", "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer")
    arcgisTool1.manageView.applyMapView({baseLayers: [layer]});

    //关键代码，只有一句，上面的都是为了生成地图
    mapLinkage.linkage("联动1", [arcgisTool, arcgisTool1])
  }, 200)
}
itemClick["解除不同地图联动"] = function (arcgisTool) {
  mapLinkage.unLinkage("联动1")
}

/*************************************基础功能***************************************************************/

itemClick["加载2D"] = function (arcgisTool) {
  let view = arcgisTool.manageView.applyMapView();
  let layer = arcgisTool.manageLayer.applyTileLayerByUrl("底图", "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer");
}
itemClick["加载3D"] = function (arcgisTool) {
  let view = arcgisTool.manageView.applySceneView();
  let layer = arcgisTool.manageLayer.applyTileLayerByUrl(null, "底图1", "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer");

}
itemClick["切换2D"] = function (arcgisTool) {
  arcgisTool.manageView.switchView(true)
}
itemClick["却换3D"] = function (arcgisTool) {
  arcgisTool.manageView.switchView(false)
}
itemClick["单地图2D_3D联动取消"] = function (arcgisTool) {
  arcgisTool.manageView.bind2D_3D(false)
}
itemClick["单地图2D_3D联动开启"] = function (arcgisTool) {
  arcgisTool.manageView.bind2D_3D(true)
}

let mapSwitchEvent = function (status) {
  console.log("地图切换的事件监听", status);
}
itemClick["添加地图切换的事件监听"] = function (arcgisTool) {
  arcgisTool.manageView.addMapSwitchEvent(mapSwitchEvent);
}
itemClick["移除地图切换事件监听"] = function (arcgisTool) {
  arcgisTool.manageView.removeMapSwitchEvent(mapSwitchEvent);
}
itemClick["添加概览图"] = function (arcgisTool) {
  //一、最简单的添加方式
  var overView = arcgisTool.manageWidget.addOverview("右上角");
  overView.arcgisTool.manageLayer.applyTileLayerByUrl("鹰眼底图", "http://120.40.102.239:9651/arcgis/rest/services/FZYUNXUAN2012CGCS2000/MapServer?f=jsapi");
  //二、自己书写概览图的位置和样式（就是写css样式）
  var styles = {
    bottom: "10px",
    left: "10px",
    border: "3px solid blue",
    borderRadius: "20px"
  }
  var overView = arcgisTool.manageWidget.addOverview("左下角", null, styles);
  var layer = overView.arcgisTool.manageLayer.applyTileLayerByUrl("鹰眼底图", "http://120.40.102.239:9651/arcgis/rest/services/Image2012CGCS2000/MapServer");
  //三、自己书写概览图的Map对象，和位置等样式
  var layer = arcgisTool.manageLayer.applyTileLayerByUrl("鹰眼底图", "http://120.40.102.239:9651/arcgis/rest/services/Image2012CGCS2000/MapServer");
  let mapConfig = {baseLayers: [layer]}
  var styles = {
    width: "500px",
    height: "500px",
    bottom: "10px",
    right: "10px",
    border: "3px solid yellow",
    borderRadius: "50%"
  }
  arcgisTool.manageWidget.addOverview("右下角", mapConfig, styles);
}
itemClick["移除概览图"] = function (arcgisTool) {
  arcgisTool.manageWidget.removeOverview("右上角");
  arcgisTool.manageWidget.removeOverview("左下角");
  arcgisTool.manageWidget.removeOverview("右下角");
}
itemClick["隐藏概览图"] = function (arcgisTool) {
  arcgisTool.manageWidget.switchOverview("右上角", false)
}
itemClick["显示概览图"] = function (arcgisTool) {
  arcgisTool.manageWidget.switchOverview("右上角", true)
}
let scaleBar = null;
itemClick["添加比例尺"] = function (arcgisTool) {
  scaleBar = arcgisTool.manageWidget.addScaleBar("bottom-left")
}
itemClick["移除比例尺"] = function (arcgisTool) {
  arcgisTool.manageWidget.removeScaleBar()
}


itemClick["打开标绘编辑工具"] = function (arcgisTool) {
  arcgisTool.manageWidget.addSketch("bottom-left")
}

itemClick["移除标绘编辑工具"] = function (arcgisTool) {
  arcgisTool.manageWidget.removeSketch();
}

itemClick["打开测量工具"] = function (arcgisTool) {
  arcgisTool.manageWidget.addMeasurement("bottom-left")
}

itemClick["移除测量工具"] = function (arcgisTool) {
  arcgisTool.manageWidget.removeMeasurement();
}
itemClick["打开全屏"] = function (arcgisTool) {
  arcgisTool.manageWidget.addFullscreen("top-right")
}

itemClick["移除全屏"] = function (arcgisTool) {
  arcgisTool.manageWidget.removeFullscreen();
}
//Legend 图例    打印功能
/*************************************定位***************************************************************/

itemClick["3D定位"] = function (arcgisTool) {
  arcgisTool.manageView.flyToPosition3D(119.27645582446667, 26.059960004653504)
}
itemClick["2D定位"] = function (arcgisTool) {
  arcgisTool.manageView.flyToPoint2D(119.27645582446667, 26.059960004653504)
}


//https://www.cnblogs.com/onsummer/category/942598.html


/*************************************图层加载方式***************************************************************/
itemClick["TileLayer"] = function (arcgisTool) {
  arcgisTool.manageLayer.applyTileLayerByUrl("TileLayer", "http://120.40.102.239:9651/arcgis/rest/services/Image2012CGCS2000/MapServer");

}
itemClick["ElevationLayer"] = function (arcgisTool) {
  let url = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
  arcgisTool.manageLayer.applyElevationLayerByUrl("高程", url);
}
itemClick["隐藏高程"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("高程", false)
}

itemClick["MapImageLayer"] = function (arcgisTool) {
  var config = {
    uniqueId: "唯一识别的Id",
    uniqueType: "MapImageLayer",
    url: "http://120.40.102.239:9651/arcgis/rest/services/%E6%95%B0%E5%AD%97%E5%9B%AD%E6%9E%97%E6%95%B0%E6%8D%AE%E5%B1%95%E7%A4%BA10_2/MapServer",
    sublayers: [
      {
        id: 5,
        uniqueId: "公厕",
        visible: true,
        renderer: {
          type: "simple",  // autocasts as new SimpleRenderer()
          symbol: {
            type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
            color: "blue",
            size: 30
          }
        }
      },
      {
        id: 2,
        uniqueId: "保安亭",
        visible: true,
      },
      {
        id: 0,
        uniqueId: "树木",
        visible: true,//是否显示
        maxScale: 100,//最大可见比例
        minScale: 2300,//最小可见比例
        popupEnabled: true,
        popupTemplate: {
          title: "{DEPTNAME1}",
          content: "{WZMS} : {OBJNAME}"
        }
      }
    ]
  }

  var config = {
    uniqueId: "唯一识别的Id",
    uniqueType: "MapImageLayer",
    // url: "http://192.168.2.244/arcgismgr/f2f7dd7501d346ef865524aecc1ac102/MapSever",
    url: "https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer",
  }

  var layer = arcgisTool.manageLayer.applyMapImageLayer(config);
  console.log(layer)
}
itemClick["FeatureLayer"] = function (arcgisTool) {

  //
  // var ycyjLayer = arcgisTool.manageLayer.applyMapImageLayer({
  //   id:"预测预警2D",
  //   url: "http://11.23.3.109:6080/arcgis/rest/services/O3_20190306Time/MapServer",
  //   sublayers: [
  //     {
  //       id: 0,
  //       visible: true,
  //       definitionExpression: "Name='2019030600'",
  //       // opacity: 0.4
  //     }
  //   ]
  // })
  // ycyjLayer.opacity=0.4;
  // var tracksSublayer = ycyjLayer.allSublayers.find(function (sublayer) {
  //   return sublayer.id === 0;
  // });
  // function addZero(num) {
  //   if (num < 10) {
  //     return "0" + num;
  //   } else {
  //     return num;
  //   }
  // }
  // function getTimeByDisHour(diffHour) {
  //   let date = new Date("2019-03-06 00:00");
  //   date.setHours(date.getHours() + diffHour);
  //   let year = date.getFullYear();
  //   let mon = date.getMonth()+1;
  //   let day = date.getDate();
  //   let hour = date.getHours();
  //   let time = addZero(year) +addZero(mon) + addZero(day) + addZero(hour);
  //   return time;
  // }
  // let diffHour = 0;
  // let _timer = setInterval(()=>{
  //   if (tracksSublayer) {
  //     diffHour = diffHour + 1;
  //     if(diffHour > 140) diffHour = 0;
  //     console.log("diffHour",diffHour)
  //     let time = getTimeByDisHour(diffHour);
  //     tracksSublayer.visible= true;
  //     tracksSublayer.definitionExpression = `Name='${time}'`
  //   }
  // },300)
  //
  //
  // return
  // let layer = arcgisTool.manageLayer.applyFeatureLayerByUrl(mapId,"公交站点", "http://120.40.102.239:9651/arcgis/rest/services/%E6%95%B0%E5%AD%97%E5%9B%AD%E6%9E%97%E6%95%B0%E6%8D%AE%E5%B1%95%E7%A4%BA10_2/MapServer/6")

  var renderer = {
    type: "simple", // autocasts as new SimpleRenderer()
    symbol: {
      type: "point-3d", // autocasts as new PointSymbol3D()
      symbolLayers: [
        {
          type: "object", // autocasts as new ObjectSymbol3DLayer()
          resource: {
            primitive: "cone"
          },
          width: 300 // width of the symbol in meters
        }
      ]
    },
    label: "宜居社区",
    visualVariables: [
      {
        type: "color",
        field: "宜居",
        stops: [
          {
            value: 5,
            color: "#2cd854"
          },
          {
            value: 4,
            color: "#11a0eb"
          },
          {
            value: 3,
            color: "#0470b5"
          },
          {
            value: 2,
            color: "#415cd1"
          },
          {
            value: 1,
            color: "#ffbf12"
          },
          {
            value: 0,
            color: "#FF9800"
          }
        ]
      },
      {
        type: "size",
        field: "面积",
        stops: [
          {
            value: 100000,
            size: 300
          },
          {
            value: 200000,
            size: 500
          },
          {
            value: 300000,
            size: 700
          },
          {
            value: 400000,
            size: 900
          },
          {
            value: 500000,
            size: 1100
          },
          {
            value: 5000000,
            size: 1500
          },
          {
            value: 7843077,
            size: 2000
          }
        ],
        axis: "height"
      },
      {
        type: "size",
        axis: "width-and-depth",
        useSymbolValue: true // uses the width value defined in the symbol layer (50,000)
      }
    ]
  };
  var labelClass = new esri.LabelClass({
    symbol: {
      type: "label-3d", // autocasts as new LabelSymbol3D()
      symbolLayers: [
        {
          type: "text", // autocasts as new TextSymbol3DLayer()
          material: {
            color: "red"
          },
          size: 10
        }
      ]
    },
    labelPlacement: "above-center",
    labelExpressionInfo: {
      expression: 'DefaultValue($feature.GRIDNAME, "no data")'
    }
  });
  let config = {
    uniqueId: "公交站点",
    // url:"http://120.40.102.239:9651/arcgis/rest/services/%E6%95%B0%E5%AD%97%E5%9B%AD%E6%9E%97%E6%95%B0%E6%8D%AE%E5%B1%95%E7%A4%BA10_2/MapServer/6",
    url: "http://11.23.3.109:6080/arcgis/rest/services/%E5%AE%9C%E5%B1%85%E7%A4%BE%E5%8C%BA%E7%BD%91%E7%82%B9/MapServer/0",
    // url: "http://11.23.3.109:6080/arcgis/rest/services/%E7%A4%BE%E5%8C%BA%E7%BD%91%E6%A0%BC%E7%82%B9/MapServer/0",
    renderer: renderer,
    labelingInfo: [labelClass],
    outFields: ["Shape_Area,GRIDNAME"],//这个输出将影响你hitTest事件能否得到属性信息
  }
  let featureLayer = arcgisTool.manageLayer.applyFeatureLayer(config);


  // featureLayer.

  return;
  let view = arcgisTool.manageView.getView(arcgisTool);
  view.on("click", (evt) => {
    var point = view.toMap({x: evt.x, y: evt.y});
    console.log("click", evt, point)

    view.hitTest(evt).then(function (response) {
      console.log("response", response)
    });
  })
}
itemClick["懒加载图层"] = function (arcgisTool) {
  //懒加载图层，为了更高的性能，为后期配置化，做准备
  window.axios.get("./static/json/懒加载图层.json").then((res) => {
    let configs = res.data;
    console.log("懒加载的配置项如下：", configs)
    arcgisTool.manageLayer.lazyLoadingLayer(configs);
  }).catch((error) => {
    console.error(error)
  })
}
itemClick["加载图层"] = function (arcgisTool) {
  //加载：方式一------根据给定的类型，统一调用
  var layer = arcgisTool.manageLayer.applyLayerByUrl("随意了1", "TileLayer", "http://120.40.102.239:9651/arcgis/rest/services/Image2012CGCS2000/MapServer");
  var layer = arcgisTool.manageLayer.applyLayerByUrl("随意了", "MapImageLayer", "http://120.40.102.239:9651/arcgis/rest/services/XFWG/MapServer");
  //加载：方式2
  var config = {
    uniqueId: "唯一识别的Id",//必须
    uniqueType: "MapImageLayer",//必须
    url: "http://120.40.102.239:9651/arcgis/rest/services/%E6%95%B0%E5%AD%97%E5%9B%AD%E6%9E%97%E6%95%B0%E6%8D%AE%E5%B1%95%E7%A4%BA10_2/MapServer",
    sublayers: [
      {
        id: 5,
        uniqueId: "公厕",
        visible: true,
        renderer: {
          type: "simple",  // autocasts as new SimpleRenderer()
          symbol: {
            type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
            color: "blue",
            size: 30
          }
        }
      },
      {
        id: 2,
        uniqueId: "保安亭",
        visible: true,
      },
      {
        id: 0,
        uniqueId: "树木",
        visible: true,//是否显示
        maxScale: 100,//最大可见比例
        minScale: 2300,//最小可见比例
        popupEnabled: true,
        popupTemplate: {
          title: "{DEPTNAME1}",
          content: "{WZMS} : {OBJNAME}"
        }
      }
    ]
  }
  var layer = arcgisTool.manageLayer.applyLayer(config);
}

/*************************************图层显隐控制***************************************************************/
itemClick["切换图层-树木true"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("树木", true)
}
itemClick["切换图层-树木false"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("树木", false)
}
itemClick["切换图层-父子图层false"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("唯一识别的Id", false)
}
itemClick["切换图层-父子图层true"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("唯一识别的Id", true)
}
itemClick["切换图层-XFWG false"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("XFWG", false)
}
itemClick["切换图层-XFWG true"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayer("XFWG", true)
}
itemClick["多图层的显示"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayers(["树木", "保安亭"], true)
}
itemClick["多图层的隐藏"] = function (arcgisTool) {
  arcgisTool.manageLayer.switchLayers(["树木", "保安亭"], false)
}

/*************************************其他工具***************************************************************/

itemClick["根据uniqueId获得layer"] = function (arcgisTool) {
  var layer = arcgisTool.manageLayer.getLayerByUniqueId("树木")
  console.log("根据uniqueId获得layer", layer);
}

itemClick["迁徙"] = function (arcgisTool) {
  window.axios.get("./static/json/迁徙.json").then((res) => {
    var allData = res.data;
    arcgisTool.manageEcharts.applyMigration("迁徙路线", allData.citys, allData.moveLines);
  }).catch((error) => {
    console.error(error)
  })
}
itemClick["点位闪烁"] = function (arcgisTool) {
  let data = [
    {"name": "乌鲁木齐", "value": [87.68, 43.77, 84]},
    {"name": "枣庄", "value": [117.57, 34.86, 84]},
    {"name": "衡水", "value": [115.72, 37.72, 50]},
  ]
  arcgisTool.manageEcharts.applyFlashingPoint("点位闪烁-circle", data);
  data = [
    {"name": "包头", "value": [110, 40.58, 80]},
    {"name": "绵阳", "value": [104.73, 31.48, 80]},
    {"name": "北京", "value": [116.46, 39.92, 79]},
    {"name": "徐州", "value": [117.2, 34.26, 79]},
    {"name": "焦作", "value": [113.21, 35.24, 75]},
    {"name": "渭南", "value": [109.5, 34.52, 72]},
    {"name": "宝鸡", "value": [107.15, 34.38, 72]},
    {"name": "福州", "value": [119.3, 26.08, 29]},
    {"name": "烟台", "value": [121.39, 37.52, 28]},
    {"name": "大庆", "value": [125.03, 46.58, 27]}
  ]
  arcgisTool.manageEcharts.applyFlashingPoint("点位闪烁-roundRect", data, "#f00", "roundRect");
  data = [
    {"name": "丹东", "value": [124.37, 40.13, 27]},
    {"name": "太仓", "value": [121.1, 31.45, 27]},
    {"name": "曲靖", "value": [103.79, 25.51, 27]},
    {"name": "厦门", "value": [118.1, 24.46, 26]}, {
      "name": "汕尾", "value": [115.375279, 22.786211, 106]
    },
    {"name": "潮州", "value": [116.63, 23.68, 26]},
    {"name": "承德", "value": [117.93, 40.97, 25]},
    {"name": "齐齐哈尔", "value": [123.97, 47.33, 14]},
    {"name": "鄂尔多斯", "value": [109.781327, 39.608266, 12]},
    {"name": "招远", "value": [120.38, 37.35, 12]},
    {"name": "舟山", "value": [122.207216, 29.985295, 12]}
  ]
  arcgisTool.manageEcharts.applyFlashingPoint("点位闪烁-pin", data, "#00f", "pin", "fill");
}
itemClick["echartLayer移除"] = function (arcgisTool) {
  arcgisTool.manageEcharts.removeEcharLayer("迁徙路线")
  arcgisTool.manageEcharts.removeEcharLayer("点位闪烁-circle")
  arcgisTool.manageEcharts.removeEcharLayer("点位闪烁-roundRect")
  arcgisTool.manageEcharts.removeEcharLayer("点位闪烁-pin")
  arcgisTool.manageEcharts.removeEcharLayer("风场")
}
itemClick["echarts风场"] = function (arcgisTool) {
  window.axios.get("./static/json/gfs.json").then((res) => {
    console.log("gfs", res)
    arcgisTool.manageEcharts.applyWindFarm("风场", res.data)
  }).catch((error) => {
    console.error(error)
  })
}
itemClick["canvas风场"] = function (arcgisTool) {
  window.axios.get("./static/json/gfs.json").then((res) => {
    console.log("暂时不行，尽量")
    let data = res.data;
    let windy = new Windy(mapId, data);
    windy.start()
  }).catch((error) => {
    console.error(error)
  })
}
itemClick["攻击点"] = function (arcgisTool) {
  let data = [
    {
      direction: false,
      from: {
        name: "上海",
        coord: [121.4648, 31.2891]
      },
      to: [
        {
          name: "尼日利亚",
          coord: [-4.388361, 11.186148],
          value: 80
        },
        {
          name: "香港邦泰",
          coord: [114.195466, 22.282751],
          value: 110
        },
        {
          name: "美国洛杉矶",
          coord: [-118.24311, 34.052713],
          value: 40
        },
      ]
    }
  ]
  arcgisTool.manageEcharts.applyPointAttack("攻击点", data)
}


itemClick["通用的家伙"] = function (arcgisTool) {

}
itemClick["代码_点"] = function (arcgisTool) {
  arcgisTool.manageGeometry.drawPointBySimple("点", 119.27645582446667, 26.059960004653504)
}
itemClick["代码_线"] = function (arcgisTool) {
  let paths = [[119.27645582446667, 26.059960004653504], [118, 26]]
  arcgisTool.manageGeometry.drawPolylineBySimple("线", paths)
}

itemClick["代码_面"] = function (arcgisTool) {
  let rings = [[119.27645582446667, 26.059960004653504], [118, 27], [118, 25]]
  arcgisTool.manageGeometry.drawPolygonBySimple("面", rings)
}

/*************************************查询***************************************************************/


itemClick['属性查询'] = function (arcgisTool) {
  //TODO 飞到某个图层的最佳位置
  // arcgisTool.manageQuery.queryAttribute("公交站点").then(res=>{
  //   console.log("查询公交站点",res)
  // });
  arcgisTool.manageQuery.queryAttribute("公厕", "管理部门='园容科'", "管理部门").then(res => {
    console.log("查询公交站点", res);
  });
}

itemClick["空间查询"] = function (arcgisTool) {
  arcgisTool.manageQuery.querySpatial().then(res => {

  })
}
itemClick["数字城管"] = function () {
  digitalManagement.init();
}
itemClick["国控站点"] = function () {
  // var data = [
  //   {"name": "师大", "value": [430208.0306564979, 2881296.537072415]},
  //   {"name": "五四北路", "value": [429723.6862754803, 2888474.0881184973]},
  //   {"name": "紫阳", "value": [431593.51622690633, 2885339.71042954]},
  //   {"name": "杨桥西路", "value": [426368.9965353124, 2885612.5083233616]},
  //   {"name": "九龙", "value": [457925.392484935, 2887248.2174401493]},
  //   {"name": "鼓山", "value": [440009.69379946403, 2883450.9973671287]},
  //   {"name": "五四北路", "value": [429723.6862754803, 2888474.0881184973]}
  // ];
  var data = [
    {"name": "师大", "aaaddd": [430208.0306564979, 2881296.537072415, 100], "value": [119.3034384, 26.03805925, 100]},
    {"name": "五四北路", "aaaddd": [429723.6862754803, 2888474.0881184973, 100], "value": [119.2982247, 26.10282861, 100]},
    {"name": "紫阳", "aaaddd": [431593.51622690633, 2885339.71042954, 100], "value": [119.3170667, 26.07462041, 100]},
    {"name": "杨桥西路", "aaaddd": [426368.9965353124, 2885612.5083233616, 100], "value": [119.2648639, 26.07684336, 100]},
    {"name": "九龙", "aaaddd": [457925.392484935, 2887248.2174401493, 100], "value": [119.58, 26.093056, 100]},
    {"name": "鼓山", "aaaddd": [440009.69379946403, 2883450.9973671287, 100], "value": [119.401236, 26.057957, 100]},
    {"name": "五四北路", "aaaddd": [429723.6862754803, 2888474.0881184973, 100], "value": [119.2982247, 26.10282861, 100]}
  ]
  arcgisTool.manageEcharts.applyFlashingPoint("点位闪烁-circle", data, "#f00");
}
itemClick["弹窗效果"] = function () {
  let view = arcgisTool.manageView.getView();
  if (!window.popupEffect) {
    window.popupEffect = new PopupEffect(view);
    window.index = 0;
  }
  let html = `<img width="500" height="300" src="./static/images/${index}.jpg"/>`
  popupEffect.open(119.27645582446667, 26.059960004653504, html);
  index = (index + 1) % 2;
}
itemClick["关闭弹窗效果"] = function () {
  window.popupEffect.remove();
}
let isShow = true;
itemClick["加载百度地图"] = function () {
  isShow = !isShow
  arcgisTool.manageLayer.switchLayer("底图图层1", isShow)
}
